<template>
    <div id="id">
        <div class="id_Head">
            <img :src="ImageInfo" alt="">
            <div class="id_middle">
                <div class="id_middle_span">Eight Door</div>
                <div>专注web前端开发</div>
            </div>
            <ul class="id_middle_ul">
                <li @click="ShowClick(index)" v-for="(val,index) in leftImg" :key="index">
                    <i style="font-size:18px;" class="iconfont" :class="val.icon"></i>{{val.title}}</li>
            </ul>
            <ul class="id_bottom">
                <li @click="Github"><i class="iconfont icon-github"></i></li>
                <li><i class="iconfont icon-rss"></i></li>
                <li @click="search"><i class="iconfont icon-sousuo"></i></li>
            </ul>
            <div style="clear:both"></div>
        </div>
    </div>
</template>
<script>
import axios from "axios";
export default {
    data() {
        return {
            ImageInfo: undefined,
            leftImg: [
                {
                    title: "首页",
                    icon: "icon-shouye "
                },
                {
                    title: "归档",
                    icon: "icon-guidangxiangmucopy"
                },
                {
                    title: "标签",
                    icon: "icon-biaoqian"
                },
                {
                    title: "笔记",
                    icon: "icon-shenhebijijishibenxiezi"
                },
                {
                    title: "关于",
                    icon: "icon-yonghu"
                },
                {
                    title: "友链",
                    icon: "icon-ziyuan"
                }
            ],
            iconfontClass: "iconfont",
            iconfontIcon: undefined
        };
    },
    created() {
        this.getImage();
    },
    methods: {
        getImage() {
            axios({
                url:
                    "https://www.easy-mock.com/mock/5b7aac9badddb15dd0d3aeb6/PersonalBlog/image",
                method: "get"
            })
                .then(response => {
                    this.ImageInfo = response.data.data.img;
                })
                .catch(response => {
                    console.log(response);
                });
        },
        Github(){
            window.open('http://www.github.com/EightDoor');
        },
        ShowClick(val){
            switch(val){
                case 0:
                this.$router.push({path:'/'})
                break;
                case 1:
                this.$router.push({path:'/File'})
                break;
                case 2:
                this.$router.push({path:'/Label'})
                break;
                case 3:
                this.$router.push({path:'/Note'})
                break;
                case 4:
                this.$router.push({path:'/about'})
                break;
                case 5:
                this.$router.push({path:'/Friendship'})
            }
        },
        search(){
            this.$router.push({path:'/search'})
        }
    }
};
</script>
<style scoped lang="scss">
#id {
    width: 250px;
    height: 100%;
    position: fixed;
    top: 0px;
    overflow: auto;
    left: 0px;
    background: #202020;
    .id_Head {
        width: 150px;
        height: 150px;
        border-radius: 50%;
        margin: 0px auto;
        margin-top: 45px;
        > img {
            width: 150px;
            height: 150px;
            border-radius: 50%;
        }
    }
}
.id_middle {
    margin-left: 20px;
    color: #999999;
    .id_middle_span {
        font-size: 25px;
        margin-bottom: 5px;
        margin-top: 20px;
        &:hover {
            cursor: pointer;
            color: #ccc;
            transition: 1s;
        }
    }
}
.id_middle_ul {
    color: #999999;
    margin: 0px;
    padding: 0px;
    margin-top: 30px;
    margin-bottom: 20px;
    > li {
        list-style: none;
        margin-bottom: 15px;
        &:hover {
            cursor: pointer;
            color: #ccc;
            transition: 1s;
        }
        > i {
            width: 16px;
            height: 16px;
            // vertical-align: middle;
            margin-right: 25px;
        }
    }
}
.id_bottom{
    margin:0px;
    padding:0px;
    margin-top:40px;
    >li{
        list-style: none;
        color:#999999;
        margin-right:25px;
        float:left;
        &:hover{
            cursor: pointer;
        }
        i{
            font-size:18px;
        }
    }
}
</style>
